Windows cheet sheet

Variable NameDescription
%PATH%Specifies a set of directories(locations) where executable programs are located.
%OS%The current operating system on the user's workstation.
%SYSTEMROOT%Expands to C:\Windows. A system-defined read-only variable containing the Windows system folder. Anything Windows considers important to its core functionality is found here, including important data, core system binaries, and configuration files.
%LOGONSERVER%Provides us with the login server for the currently active user followed by the machine's hostname. We can use this information to know if a machine is joined to a domain or workgroup.
%USERPROFILE%Provides us with the location of the currently active user's home directory. Expands to C:\Users\{username}.
%ProgramFiles%Equivalent of C:\Program Files. This location is where all the programs are installed on an x64 based system.
%ProgramFiles(x86)%Equivalent of C:\Program Files (x86). This location is where all 32-bit programs running under WOW64 are installed. Note that this variable is only accessible on a 64-bit host. It can be used to indicate what kind of host we are interacting with. (x86 vs. x64 architecture)

more variables can be found here https://ss64.com/nt/syntax-variables.html

Tools To Be Aware Of

Below we will quickly list a few PowerShell modules and projects we, as penetration testers and sysadmins, should be aware of. Each of these tools brings a new capability to use within PowerShell. Of course, there are plenty more than just our list; these are just several we find ourselves returning to on every engagement.

TCP PORTS

ProtocolAcronymPortDescription
TelnetTelnet23Remote login service
Secure ShellSSH22Secure remote login service
Simple Network Management ProtocolSNMP161-162Manage network devices
Hyper Text Transfer ProtocolHTTP80Used to transfer webpages
Hyper Text Transfer Protocol SecureHTTPS443Used to transfer secure webpages
Domain Name SystemDNS53Lookup domain names
File Transfer ProtocolFTP20-21Used to transfer files
Trivial File Transfer ProtocolTFTP69Used to transfer files
Network Time ProtocolNTP123Synchronize computer clocks
Simple Mail Transfer ProtocolSMTP25Used for email transfer
Post Office ProtocolPOP3110Used to retrieve emails
Internet Message Access ProtocolIMAP143Used to access emails
Server Message BlockSMB445Used to transfer files
Network File SystemNFS1112049Used to mount remote systems
Bootstrap ProtocolBOOTP6768Used to bootstrap computers
KerberosKerberos88Used for authentication and authorization
Lightweight Directory Access ProtocolLDAP389Used for directory services
Remote Authentication Dial-In User ServiceRADIUS18121813Used for authentication and authorization
Dynamic Host Configuration ProtocolDHCP6768Used to configure IP addresses
Remote Desktop ProtocolRDP3389Used for remote desktop access
Network News Transfer ProtocolNNTP119Used to access newsgroups
Remote Procedure CallRPC135137-139Used to call remote procedures
Identification ProtocolIdent113Used to identify user processes
Internet Control Message ProtocolICMP0-255Used to troubleshoot network issues
Internet Group Management ProtocolIGMP0-255Used for multicasting
Oracle DB (Default/Alternative) Listeneroracle-tns1521/1526The Oracle database default/alternative listener is a service that runs on the database host and receives requests from Oracle clients.
Ingres Lockingreslock1524Ingres database is commonly used for large commercial applications and as a backdoor that can execute commands remotely via RPC.
Squid Web Proxyhttp-proxy3128Squid web proxy is a caching and forwarding HTTP web proxy used to speed up a web server by caching repeated requests.
Secure Copy ProtocolSCP22Securely copy files between systems
Session Initiation ProtocolSIP5060Used for VoIP sessions
Simple Object Access ProtocolSOAP80443Used for web services
Secure Socket LayerSSL443Securely transfer files
TCP WrappersTCPW113Used for access control
Internet Security Association and Key Management ProtocolISAKMP500Used for VPN connections
Microsoft SQL Serverms-sql-s1433Used for client connections to the Microsoft SQL Server.
Kerberized Internet Negotiation of KeysKINK892Used for authentication and authorization
Open Shortest Path FirstOSPF89Used for routing
Point-to-Point Tunneling ProtocolPPTP1723Is used to create VPNs
Remote ExecutionREXEC512This protocol is used to execute commands on remote computers and send the output of commands back to the local computer.
Remote LoginRLOGIN513This protocol starts an interactive shell session on a remote computer.
X Window SystemX116000It is a computer software system and network protocol that provides a graphical user interface (GUI) for networked computers.
Relational Database Management SystemDB250000RDBMS is designed to store, retrieve and manage data in a structured format for enterprise applications such as financial systems, customer relationship management (CRM) systems.

UDP Ports

ProtocolAcronymPortDescription
Domain Name SystemDNS53It is a protocol to resolve domain names to IP addresses.
Trivial File Transfer ProtocolTFTP69It is used to transfer files between systems.
Network Time ProtocolNTP123It synchronizes computer clocks in a network.
Simple Network Management ProtocolSNMP161It monitors and manages network devices remotely.
Routing Information ProtocolRIP520It is used to exchange routing information between routers.
Internet Key ExchangeIKE500Internet Key Exchange
Bootstrap ProtocolBOOTP68It is used to bootstrap hosts in a network.
Dynamic Host Configuration ProtocolDHCP67It is used to assign IP addresses to devices in a network dynamically.
TelnetTELNET23It is a text-based remote access communication protocol.
MySQLMySQL3306It is an open-source database management system.
Terminal ServerTS3389It is a remote access protocol used for Microsoft Windows Terminal Services by default.
NetBIOS Namenetbios-ns137It is used in Windows operating systems to resolve NetBIOS names to IP addresses on a LAN.
Microsoft SQL Serverms-sql-m1434Used for the Microsoft SQL Server Browser service.
Universal Plug and PlayUPnP1900It is a protocol for devices to discover each other on the network and communicate.
PostgreSQLPGSQL5432It is an object-relational database management system.
Virtual Network ComputingVNC5900It is a graphical desktop sharing system.
X Window SystemX116000-6063It is a computer software system and network protocol that provides GUI on Unix-like systems.
SyslogSYSLOG514It is a standard protocol to collect and store log messages on a computer system.
Internet Relay ChatIRC194It is a real-time Internet text messaging (chat) or synchronous communication protocol.
OpenPGPOpenPGP11371It is a protocol for encrypting and signing data and communications.
Internet Protocol SecurityIPsec500IPsec is also a protocol that provides secure, encrypted communication. It is commonly used in VPNs to create a secure tunnel between two devices.
Internet Key ExchangeIKE11371It is a protocol for encrypting and signing data and communications.
X Display Manager Control ProtocolXDMCP177XDMCP is a network protocol that allows a user to remotely log in to a computer running the X11.